Skip to content

Merge subtree update for toolchain nightly-2025-07-10 #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10,000 commits into from

Conversation

github-actions[bot]
Copy link

This is an automated PR to merge library subtree updates from 2025-07-02 (rust-lang/rust@71e4c00) to 2025-07-10 (rust-lang/rust@e43d139) (inclusive) into main. git merge resulted in conflicts, which require manual resolution. Files were commited with merge conflict markers. Do not remove or edit the following annotations:
git-subtree-dir: library
git-subtree-split: d836404

GuillaumeGomez and others added 30 commits June 16, 2025 11:27
…enton

Stabilize "file_lock" feature

Closes rust-lang#130994

r? ```@joshtriplett```
…cs, r=tgross35

Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls

I think it's not very obvious that `PathBuf`'s `Extend` and `FromIterator` impls work like `PathBuf::push`, so I think these should be documented.
I'm not very happy with the wording and examples, open to suggestions :)
Introduce the `MetaSized` and `PointeeSized` traits as supertraits of
`Sized` and initially implement it on everything that currently
implements `Sized` to isolate any changes that simply adding the
traits introduces.
more information to Display implementation for BorrowError/BorrowMutError

- The BorrowError/BorrowMutError Debug implementations do not print
anything differently from what the derived implementation does, so we
don't need it.

- This change also adds the location field of
BorrowError/BorrowMutError to the the Display output when it is
present, rewords the error message, and uses the Display trait for
outputting the error message instead of Debug.
It's actually used as a counter so update the name to reflect that.
…ngjubilee

Update the `backtrace` submodule

Pick up the following pull requests:

* ci: remove binary size check (not relevant in rust-lang/rust) <rust-lang/backtrace-rs#710>
* Upgrade `ruzstd`, `object`, and `addr2line` to the latest versions <rust-lang/backtrace-rs#718>
As core uses an extern type (`ptr::VTable`), the default `?Sized` to
`MetaSized` migration isn't sufficient, and some code that previously
accepted `VTable` needs relaxed to continue to accept extern types.

Similarly, the compiler uses many extern types in `rustc_codegen_llvm`
and in the `rustc_middle::ty::List` implementation (`OpaqueListContents`)
some bounds must be relaxed to continue to accept these types.

Unfortunately, due to the current inability to relax `Deref::Target`,
some of the bounds in the standard library are forced to be stricter than
they ideally would be.
Adding a sizedness supertrait shouldn't require multiple vtables so
shouldn't be linted against.
Make performance description of String::{insert,insert_str,remove} more precise
std: refactor explanation of `NonNull`

Fixes rust-lang#141933

I cut out the excessive explanation and used an example to explain how to maintain invariance, but I think what is quoted in the *rust reference* in the document needs to be added with a more layman's explanation and example.

(I'm not sure if I deleted too much)

r? `@workingjubilee`
Miscellaneous RefCell cleanups

- Clarify `RefCell` error messages when borrow rules are broken
- Remove `Debug` impl for `BorrowError`/`BorrowMutError` since `#derive(Debug)` provides identical functionality
- Rename `BorrowFlag` to `BorrowCounter`
Sized Hierarchy: Part I

This patch implements the non-const parts of rust-lang/rfcs#3729. It introduces two new traits to the standard library, `MetaSized` and `PointeeSized`. See the RFC for the rationale behind these traits and to discuss whether this change makes sense in the abstract.

These traits are unstable (as is their constness), so users cannot refer to them without opting-in to `feature(sized_hierarchy)`. These traits are not behind `cfg`s as this would make implementation unfeasible, there would simply be too many `cfg`s required to add the necessary bounds everywhere. So, like `Sized`, these traits are automatically implemented by the compiler.

RFC 3729 describes changes which are necessary to preserve backwards compatibility given the introduction of these traits, which are implemented and as follows:

- `?Sized` is rewritten as `MetaSized`
- `MetaSized` is added as a default supertrait for all traits w/out an explicit sizedness supertrait already.

There are no edition migrations implemented in this,  as these are primarily required for the constness parts of the RFC and prior to stabilisation of this (and so will come in follow-up PRs alongside the const parts). All diagnostic output should remain the same (showing `?Sized` even if the compiler sees `MetaSized`) unless the `sized_hierarchy` feature is enabled.

Due to the use of unstable extern types in the standard library and rustc, some bounds in both projects have had to be relaxed already - this is unfortunate but unavoidable so that these extern types can continue to be used where they were before. Performing these relaxations in the standard library and rustc are desirable longer-term anyway, but some bounds are not as relaxed as they ideally would be due to the inability to relax `Deref::Target` (this will be investigated separately).

It is hoped that this is implemented such that it could be merged and these traits could exist "under the hood" without that being observable to the user (other than in any performance impact this has on the compiler, etc). Some details might leak through due to the standard library relaxations, but this has not been observed in test output.

**Notes:**

- Any commits starting with "upstream:" can be ignored, as these correspond to other upstream PRs that this is based on which have yet to be merged.
- This best reviewed commit-by-commit. I've attempted to make the implementation easy to follow and keep similar changes and test output updates together.
  - Each commit has a short description describing its purpose.
  - This patch is large but it's primarily in the test suite.
- I've worked on the performance of this patch and a few optimisations are implemented so that the performance impact is neutral-to-minor.
- `PointeeSized` is a different name from the RFC just to make it more obvious that it is different from `std::ptr::Pointee` but all the names are yet to be bikeshed anyway.
- `@nikomatsakis` has confirmed [that this can proceed as an experiment from the t-lang side](https://rust-lang.zulipchat.com/#narrow/channel/435869-project-goals/topic/SVE.20and.20SME.20on.20AArch64.20.28goals.23270.29/near/506196491)
- FCP in rust-lang#137944 (comment)

Fixes rust-lang#79409.

r? `@ghost` (I'll discuss this with relevant teams to find a reviewer)
This includes a fix for building on gnux32.

[1]: https://github.com/rust-lang/libc/releases/tag/0.2.174
…kingjubilee

Rollup of 13 pull requests

Successful merges:

 - rust-lang#138538 (Make performance description of String::{insert,insert_str,remove} more precise)
 - rust-lang#141946 (std: refactor explanation of `NonNull`)
 - rust-lang#142216 (Miscellaneous RefCell cleanups)
 - rust-lang#142542 (Manually invalidate caches in SimplifyCfg.)
 - rust-lang#142563 (Refine run-make test ignores due to unpredictable `i686-pc-windows-gnu` unwind mechanism)
 - rust-lang#142570 (Reject union default field values)
 - rust-lang#142584 (Handle same-crate macro for borrowck semicolon suggestion)
 - rust-lang#142585 (Update books)
 - rust-lang#142586 (Fold unnecessary `visit_struct_field_def` in AstValidator)
 - rust-lang#142587 (Make sure to propagate result from `visit_expr_fields`)
 - rust-lang#142595 (Revert overeager warning for misuse of `--print native-static-libs`)
 - rust-lang#142598 (Set elf e_flags on ppc64 targets according to abi)
 - rust-lang#142601 (Add a comment to `FORMAT_VERSION`.)

r? `@ghost`
`@rustbot` modify labels: rollup
Adds checking of PR descriptions to avoid relative issue links (without repository prefix) and mentions in commits.
Fixing the issue mentioned in issue rust-lang#1822 of rust-lang/stdarch.
…mm_alignr_epi8 in ssse3.rs, also removed the import of the unreachable unchecked hint as it was no longer necessary
bors and others added 17 commits July 7, 2025 02:03
Rollup of 9 pull requests

Successful merges:

 - rust-lang#143206 (Align attr fixes)
 - rust-lang#143236 (Stabilize `mixed_integer_ops_unsigned_sub`)
 - rust-lang#143344 (Port `#[path]` to the new attribute parsing infrastructure )
 - rust-lang#143359 (Link to 2024 edition page for `!` fallback changes)
 - rust-lang#143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`)
 - rust-lang#143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP)
 - rust-lang#143535 (Remove duplicate word)
 - rust-lang#143544 (compiler: rename BareFn to FnPtr)
 - rust-lang#143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`)

r? `@ghost`
`@rustbot` modify labels: rollup
doc(std): clarify `NonZero<T>` usage limitation in doc comment

Closes rust-lang#142966

This PR clarifies `NonZero<T>` usage limitation in doc comment and fixes a typo.

r? libs
std: fix typo in `std::path`

I noticed that most of the document used `'` instead of `’`, so I adjusted it.

r? `@ibraheemdev`
Full list of `impl const Default` types:

- ()
- bool
- char
- Cell
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData<T>
- Option<T>
- std::iter::Empty<T>
- std::ptr::Alignment
- &[T]
- &mut [T]
- &str
- &mut str
- String
- Vec<T>
…Amanieu

Implement `int_format_into` feature

I took over rust-lang#138338 with `@madhav-madhusoodanan's` approval.

Since rust-lang#136264, a lot of changes happened so I made use of them to reduce the number of changes.

ACP approval: rust-lang/libs-team#546 (comment)

## Associated Issue
- rust-lang#138215

r? `@hanna-kruppe`
…trieb

Fix in std::String docs

This PR removes the word “else” from the sentence ('something else similar') in the String documentation to improve clarity.
Fixes rust-lang#143579.
…t, r=tgross35

Simplify num formatting helpers

Noticed `ilog10` was being open-coded when looking at this diff: https://github.com/rust-lang/rust/pull/143423/files/85d6768f4c437a0f3799234df20535ff65ee17c2..76d9775912ef3a7ee145053a5119538bf229d6e5#diff-6be9b44b52d946ccac652ddb7c98146a01b22ea0fc5737bc10db245a24796a45
That, and two other small cleanups 😁

(should probably go through perf just to make sure it doesn't regress formatting)
Make `Default` const and add some `const Default` impls

Full list of `impl const Default` types:

- ()
- bool
- char
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData<T>
- Option<T>
- std::iter::Empty<T>
- std::ptr::Alignment
- &[T]
- &mut [T]
- &str
- &mut str
- String
- Vec<T>
clippy fix: indentation

Fixes indentation of markdown comments.
@github-actions github-actions bot requested a review from a team as a code owner July 11, 2025 14:11
@carolynzech
Copy link

Looks like this is surfacing an issue with loop invariants, cc @thanhnguyen-aws

@carolynzech carolynzech removed their assignment Jul 14, 2025
@thanhnguyen-aws
Copy link

I replace this PR with #417.

github-merge-queue bot pushed a commit that referenced this pull request Jul 22, 2025
This PR replaces the failed PR
#413 by fixing the
loop invariant for `small_slice_eq`.

Automated PR (413) description: 
This is an automated PR to merge library subtree updates from 2025-07-02
(rust-lang@71e4c00)
to 2025-07-10
(rust-lang@e43d139)
(inclusive) into main. git merge resulted in conflicts, which require
manual resolution. Files were commited with merge conflict markers. Do
not remove or edit the following annotations:
git-subtree-dir: library
git-subtree-split: d836404

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Signed-off-by: Ayush Singh <[email protected]>
Signed-off-by: xizheyin <[email protected]>
Co-authored-by: Guillaume Gomez <[email protected]>
Co-authored-by: Jakub Beránek <[email protected]>
Co-authored-by: David Wood <[email protected]>
Co-authored-by: Neal <[email protected]>
Co-authored-by: Tomoaki Kobayashi <[email protected]>
Co-authored-by: Daniel Paoliello <[email protected]>
Co-authored-by: Marijn Schouten <[email protected]>
Co-authored-by: Marijn Schouten <[email protected]>
Co-authored-by: Jubilee <[email protected]>
Co-authored-by: Benoît du Garreau <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: Trevor Gross <[email protected]>
Co-authored-by: Aniket Mishra <[email protected]>
Co-authored-by: satiscugcat <[email protected]>
Co-authored-by: Jacob Pratt <[email protected]>
Co-authored-by: Jeremy Smart <[email protected]>
Co-authored-by: Mara Bos <[email protected]>
Co-authored-by: Urgau <[email protected]>
Co-authored-by: Zachary S <[email protected]>
Co-authored-by: Trevor Gross <[email protected]>
Co-authored-by: Tim (Theemathas) Chirananthavat <[email protected]>
Co-authored-by: Alice Ryhl <[email protected]>
Co-authored-by: Folkert de Vries <[email protected]>
Co-authored-by: Kornel <[email protected]>
Co-authored-by: LimpSquid <[email protected]>
Co-authored-by: Daniel Bloom <[email protected]>
Co-authored-by: Ed Page <[email protected]>
Co-authored-by: The Miri Cronjob Bot <[email protected]>
Co-authored-by: Chai T. Rex <[email protected]>
Co-authored-by: Valdemar Erk <[email protected]>
Co-authored-by: bjorn3 <[email protected]>
Co-authored-by: Samuel Tardieu <[email protected]>
Co-authored-by: binarycat <[email protected]>
Co-authored-by: Tshepang Mbambo <[email protected]>
Co-authored-by: Matthias Krüger <[email protected]>
Co-authored-by: mejrs <[email protected]>
Co-authored-by: Laine Taffin Altman <[email protected]>
Co-authored-by: Oli Scherer <[email protected]>
Co-authored-by: MetaNova <[email protected]>
Co-authored-by: Kurt Heiritz (pseudo) <[email protected]>
Co-authored-by: krikera <[email protected]>
Co-authored-by: Pavel Grigorenko <[email protected]>
Co-authored-by: Michael Goulet <[email protected]>
Co-authored-by: Bastian Kersting <[email protected]>
Co-authored-by: Deadbeef <[email protected]>
Co-authored-by: Cheng Xu <[email protected]>
Co-authored-by: Chris Denton <[email protected]>
Co-authored-by: наб <[email protected]>
Co-authored-by: kilavvy <[email protected]>
Co-authored-by: Ralf Jung <[email protected]>
Co-authored-by: zachs18 <[email protected]>
Co-authored-by: dianqk <[email protected]>
Co-authored-by: Nurzhan Sakén <[email protected]>
Co-authored-by: Benjamin Schulz <[email protected]>
Co-authored-by: Amanieu d'Antras <[email protected]>
Co-authored-by: Josh Stone <[email protected]>
Co-authored-by: klensy <[email protected]>
Co-authored-by: clubby789 <[email protected]>
Co-authored-by: Jana Dönszelmann <[email protected]>
Co-authored-by: Urgau <[email protected]>
Co-authored-by: Ayush Singh <[email protected]>
Co-authored-by: Ben Kimock <[email protected]>
Co-authored-by: Joshua Gentry <[email protected]>
Co-authored-by: dvdsk <[email protected]>
Co-authored-by: Yotam Ofek <[email protected]>
Co-authored-by: Simonas Kazlauskas <[email protected]>
Co-authored-by: xizheyin <[email protected]>
Co-authored-by: 许杰友 Jieyou Xu (Joe) <[email protected]>
Co-authored-by: Md. Yeasin Arafat <[email protected]>
Co-authored-by: Esteban Küber <[email protected]>
Co-authored-by: gitbot <git@bot>
Co-authored-by: Michael Tautschnig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.